package com.crane.oss.web.controller.school;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.crane.common.core.dto.MultiResponse;
import com.crane.common.core.dto.Response;
import com.crane.common.core.dto.SingleResponse;
import com.crane.oss.school.bean.request.QueryStudentChangeClassReq;
import com.crane.oss.school.bean.request.studentchangeclass.AddStudentChangeClassReq;
import com.crane.oss.school.bean.request.studentchangeclass.UpdateStudentChangeClassReq;
import com.crane.oss.school.bean.resp.StudentChangeClassResp;
import com.crane.oss.school.service.StudentChangeClassService;
import com.crane.oss.web.BaseBusinessController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * @author zhenxing.pi
 * @email ccsu123456@qq.com
 * @date 2022年03月26日 14时24分54秒
 */

@Api(value = "StudentChangeClassController", tags = {"生源异动管理"})
@RestController
@RequestMapping("/school/studentChangeClass")
public class StudentChangeClassController extends BaseBusinessController {

    @Autowired
    StudentChangeClassService studentChangeClassService;


    @ApiOperation(value = "获取列表信息", notes = "获取列表信息")
    @ApiImplicitParam(name = "request", value = "请求对象", required = true, dataType = "QueryStudentChangeClassReq")
    @RequiresPermissions("school:studentchangeclass:list")
    @PostMapping("/list")
    public MultiResponse<StudentChangeClassResp> list(@RequestBody QueryStudentChangeClassReq request) {
    	request.setPartyId(getPartyId());
        IPage<StudentChangeClassResp> page = studentChangeClassService.queryList(request);
        return MultiResponse.of(page.getRecords(), (int) page.getTotal(), request);
    }


}
